package org.dna.metronomo.persistence.impl;

import org.apache.ibatis.session.SqlSession;
import org.dna.metronomo.persistence.impl.annotations.SessionField;
import org.dna.metronomo.persistence.impl.annotations.SessionMethod;
import org.tigris.scarab.mapper.IssueMapper;

/**
 * Fake DAO used to test sessions annotations
 * 
 * 
 * @author andrea
 */
public class FakeSessionDAO implements IFakeSessionDAO {

    @SessionField
    SqlSession m_session;

    @SessionMethod
    public boolean checkSession() {
        IssueMapper mapper = m_session.getMapper(IssueMapper.class);
        return mapper != null;
    }

    public boolean notSession() {
        return m_session == null;
    }
}
